Returns a variant string that represents the current path of the specified drive.
指定ドライブの現在のパスを示す文字列を返します。
CurDir [(Text As String)]
CurDir [(Text As String)]
String
文字列
Text: Any string expression that specifies an existing drive (for example, "C" for the first partition of the first hard drive).
Text: 既存のドライブを示す文字列表式 (たとえば 1 番目のドライブの第 1 パーティションを指定するには「C」とします)。
If no drive is specified or if the drive is a zero-length string (""), CurDir returns the path for the current drive. Office Basic reports an error if the syntax of the drive description is incorrect, the drive does not exist, or if the drive letter occurs after the letter defined in the CONFIG.SYS with the Lastdrive statement.
ドライブを指定しないか文字長ゼロの空白文字列を指定した場合 ("")、CurDir は現在のドライブのパスを返します。 有効なドライブ指定でない場合、ドライブが存在しない場合、CONFIG.SYS の Lastdrive ステートメントによる設定値を超えたドライブレターの場合、Office Basic はエラーを報告します。
This function is not case-sensitive.
この関数の引数では、大文字と小文字は区別されません。
Sub ExampleCurDir
Sub ExampleCurDir
Dim sDir1 as String , sDir2 as String
Dim sDir1 as String , sDir2 as String
sDir1 = "c:\Test"
sDir1 = "c:\Test"
sDir2 = "d:\private"
sDir2 = "d:\private"
ChDir( sDir1 )
ChDir( sDir1 )
msgbox CurDir
msgbox CurDir
ChDir( sDir2 )
ChDir( sDir2 )
msgbox CurDir
msgbox CurDir
end sub
end sub